﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace GroupMeal.Migrations
{
    /// <inheritdoc />
    public partial class EntityEdit : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MerchantFoods_MerchantFoodTypes_FoodTypeId",
                table: "MerchantFoods");

            migrationBuilder.AddColumn<int>(
                name: "Count",
                table: "MaterialDetails",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddForeignKey(
                name: "FK_MerchantFoods_MerchantFoodTypes_FoodTypeId",
                table: "MerchantFoods",
                column: "FoodTypeId",
                principalTable: "MerchantFoodTypes",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MerchantFoods_MerchantFoodTypes_FoodTypeId",
                table: "MerchantFoods");

            migrationBuilder.DropColumn(
                name: "Count",
                table: "MaterialDetails");

            migrationBuilder.AddForeignKey(
                name: "FK_MerchantFoods_MerchantFoodTypes_FoodTypeId",
                table: "MerchantFoods",
                column: "FoodTypeId",
                principalTable: "MerchantFoodTypes",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
